<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>gamvas.Vector2D</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.51 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="gamvas.Vector2D"></a>gamvas.<wbr>Vector2D</h1><div class=CBody><h4 class=CHeading>Description</h4><p>A 2D vector class</p><h4 class=CHeading>Constructor</h4><p>new gamvas.Vector2D(x, y);</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x</td><td class=CDLDescription>The x part of the vector (optional)</td></tr><tr><td class=CDLEntry>y</td><td class=CDLDescription>The y part of the vector (optional)</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#gamvas.Vector2D" >gamvas.<wbr>Vector2D</a></td><td class=SDescription>A 2D vector class</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#gamvas.Vector2D.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Vector2D.x" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">x</a></td><td class=SDescription>The x direction of the vector, also used as coordinate value for some functions.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.Vector2D.y" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">y</a></td><td class=SDescription>The y direction of the vector, also used as coordinate value for some functions.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#gamvas.Vector2D.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Vector2D.length" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">length</a></td><td class=SDescription>Return the length of the vector in pixels. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Vector2D.quickLength" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">quickLength</a></td><td class=SDescription>Returns the non sqrt() length of the vector, which is faster to calculate as it&rsquo;s real length. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Vector2D.normalized" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">normalized</a></td><td class=SDescription>Returns the normalized vector of a vector. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Vector2D.rotate" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">rotate</a></td><td class=SDescription>Returns a new vector with the current vector rotated a certain angle. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Vector2D.subtract" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">subtract</a></td><td class=SDescription>Returns a new vector subtracting vector v from current vector</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Vector2D.add" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">add</a></td><td class=SDescription>Returns a new vector adding vector v to the current vector</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Vector2D.difference" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">difference</a></td><td class=SDescription>Returns a new vector holding the difference between vector v and the current vector</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Vector2D.copy" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">copy</a></td><td class=SDescription>Returns a copy of the vector</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Vector2D.distance" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">distance</a></td><td class=SDescription>Returns the distance between the current vector and vector v</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Vector2D.quickDistance" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">quickDistance</a></td><td class=SDescription>Returns a comparable distance between the current vector and vector v</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.x"></a>x</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>(</td><td class="PParameter  prettyprint " nowrap>x</td><td class="PAfterParameters  prettyprint "nowrap>) ? this.x</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The x direction of the vector, also used as coordinate value for some functions.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.y"></a>y</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>(</td><td class="PParameter  prettyprint " nowrap>y</td><td class="PAfterParameters  prettyprint "nowrap>) ? this.y</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The y direction of the vector, also used as coordinate value for some functions.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.length"></a>length</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">gamvas.Vector2D.prototype.length = function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Return the length of the vector in pixels.&nbsp; This calculates the correct length of a vector which uses sqrt() and therefor is slow.&nbsp; If you just want compare two vectors, see <a href="#gamvas.Vector2D.quickLength" class=LFunction id=link13 onMouseOver="ShowTip(event, 'tt4', 'link13')" onMouseOut="HideTip('tt4')">gamvas.Vector2D.quickLength</a></p><h4 class=CHeading>See</h4><p><a href="#gamvas.Vector2D.quickLength" class=LFunction id=link14 onMouseOver="ShowTip(event, 'tt4', 'link14')" onMouseOut="HideTip('tt4')">gamvas.Vector2D.quickLength</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.quickLength"></a>quickLength</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">gamvas.Vector2D.prototype.quickLength = function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Returns the non sqrt() length of the vector, which is faster to calculate as it&rsquo;s real length.&nbsp; Use it if you want to compare to vectors in length.&nbsp; If you need the actual length of the vector, use the slower <a href="#gamvas.Vector2D.length" class=LFunction id=link15 onMouseOver="ShowTip(event, 'tt3', 'link15')" onMouseOut="HideTip('tt3')">gamvas.Vector2D.length</a></p><h4 class=CHeading>See</h4><p><a href="#gamvas.Vector2D.length" class=LFunction id=link16 onMouseOver="ShowTip(event, 'tt3', 'link16')" onMouseOut="HideTip('tt3')">gamvas.Vector2D.length</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.normalized"></a>normalized</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">gamvas.Vector2D.prototype.normalized = function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Returns the normalized vector of a vector.&nbsp; The normalized vector is the vector with length of 1.</p><h4 class=CHeading>Returns</h4><p><a href="#gamvas.Vector2D" class=LClass id=link17 onMouseOver="ShowTip(event, 'tt13', 'link17')" onMouseOut="HideTip('tt13')">gamvas.Vector2D</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.rotate"></a>rotate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.rotate = function(</td><td class="PParameter  prettyprint " nowrap>r</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Returns a new vector with the current vector rotated a certain angle.&nbsp; The angle is in radians.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>r</td><td class=CDLDescription>Rotation in radians</td></tr></table><h4 class=CHeading>Returns</h4><p><a href="#gamvas.Vector2D" class=LClass id=link18 onMouseOver="ShowTip(event, 'tt13', 'link18')" onMouseOut="HideTip('tt13')">gamvas.Vector2D</a></p><h4 class=CHeading>See</h4><p><a href="http://en.wikipedia.org/wiki/Radians" class=LURL target=_top>http://en.wikipedia.org/wiki/Radians</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.subtract"></a>subtract</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.subtract = function(</td><td class="PParameter  prettyprint " nowrap>v</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a new vector subtracting vector v from current vector</p><h4 class=CHeading>Example</h4><blockquote><pre>var vec1 = new gamvas.Vector2D(1, 1);
var vec2 = new gamvas.Vector2D(2, 2);
var subtracted = vec1.subtract(vec2);</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.add"></a>add</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.add = function(</td><td class="PParameter  prettyprint " nowrap>v</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a new vector adding vector v to the current vector</p><h4 class=CHeading>Example</h4><blockquote><pre>var vec1 = new gamvas.Vector2D(1, 1);
var vec2 = new gamvas.Vector2D(2, 2);
var added = vec1.add(vec2);</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.difference"></a>difference</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.difference = function(</td><td class="PParameter  prettyprint " nowrap>v</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a new vector holding the difference between vector v and the current vector</p><h4 class=CHeading>Example</h4><blockquote><pre>var vec1 = new gamvas.Vector2D(1, 1);
var vec2 = new gamvas.Vector2D(2, 2);
var diff = vec1.difference(vec2);</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.copy"></a>copy</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">gamvas.Vector2D.prototype.copy = function()</td></tr></table></blockquote><p>Returns a copy of the vector</p><h4 class=CHeading>Example</h4><blockquote><pre>var vec1 = new gamvas.Vector2D(1, 1);
var vec2 = vec1.copy();
vec2.x += 1;
console.log(vec1.x); // will be 1
console.log(vec2.x); // will be 2</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.distance"></a>distance</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.distance = function(</td><td class="PParameter  prettyprint " nowrap>v</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the distance between the current vector and vector v</p><h4 class=CHeading>Description</h4><p>This uses the sqrt() function which might be too slow, if you just need to compare several distances, see <a href="#gamvas.Vector2D.quickDistance" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt12', 'link19')" onMouseOut="HideTip('tt12')">gamvas.Vector2D.quickDistance</a> for a faster version</p><h4 class=CHeading>Example</h4><blockquote><pre>var vec1 = new gamvas.Vector2D(1, 1);
var vec2 = new gamvas.Vector2D(2, 3);
console.log('The vectors are '+vec1.distance(vec2)+' units away');</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Vector2D.quickDistance"></a>quickDistance</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.quickDistance = function(</td><td class="PParameter  prettyprint " nowrap>v</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a comparable distance between the current vector and vector v</p><h4 class=CHeading>Description</h4><p>This is faster then testing the distance with <a href="#gamvas.Vector2D.distance" class=LFunction id=link20 onMouseOver="ShowTip(event, 'tt11', 'link20')" onMouseOut="HideTip('tt11')">gamvas.Vector2D.distance</a> but does not give the actual distance, only a comparable value</p><h4 class=CHeading>Example</h4><blockquote><pre>var vec1 = new gamvas.Vector2D(1, 1);
var vec2 = new gamvas.Vector2D(2, 3);
var vec3 = new gamvas.Vector2D(3, 4);
var distv1v2 = vec1.quickDistance(vec2);
var distv1v3 = vec1.quickDistance(vec3);
if (distv1v2 &gt; distv1v3) {
   console.log('vector 1 is closer to vector 2');
} else {
   console.log('vector 1 is closer to vector 3');
}</pre></blockquote></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile><a href="gamvas-base-js.html">gamvas</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-actor-js.html">gamvas.<wbr>Actor</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-actorstate-js.html">gamvas.<wbr>ActorState</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-animation-js.html">gamvas.<wbr>Animation</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astar-js.html">gamvas.<wbr>AStar</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astargrid-js.html">gamvas.<wbr>AStarGrid</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astargridnode-js.html">gamvas.<wbr>AStarGridNode</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astarmap-js.html">gamvas.<wbr>AStarMap</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astarnode-js.html">gamvas.<wbr>AStarNode</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-camera-js.html">gamvas.<wbr>Camera</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-class-js.html">gamvas.<wbr>Class</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-config-js.html">gamvas.<wbr>config</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-dom-js.html">gamvas.dom</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-event-js.html">gamvas.<wbr>event</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-image-js.html">gamvas.<wbr>Image</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-key-js.html">gamvas.key</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-math-js.html">gamvas.math</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-mouse-js.html">gamvas.<wbr>mouse</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-particleemitter-js.html">gamvas.<wbr>ParticleEmitter</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-physics-js.html">gamvas.<wbr>physics</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-physics-userdata-js.html">gamvas.<wbr>physics.<wbr>UserData</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-rect-js.html">gamvas.Rect</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-resource-js.html">gamvas.<wbr>Resource</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-screen-js.html">gamvas.<wbr>screen</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-sound-js.html">gamvas.<wbr>Sound</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-state-js.html">gamvas.<wbr>state</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-state-state-js.html">gamvas.<wbr>State</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-timer-js.html">gamvas.<wbr>timer</a></div></div><div class=MEntry><div class=MFile id=MSelected>gamvas.<wbr>Vector2D</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Macros.html">Macros</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Functions">Functions</option><option value="Macros">Macros</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([], 2);// --></script></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>(</td><td class="PParameter  prettyprint " nowrap>x</td><td class="PAfterParameters  prettyprint "nowrap>) ? this.x</td></tr></table></td></tr></table></blockquote>The x direction of the vector, also used as coordinate value for some functions.</div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>(</td><td class="PParameter  prettyprint " nowrap>y</td><td class="PAfterParameters  prettyprint "nowrap>) ? this.y</td></tr></table></td></tr></table></blockquote>The y direction of the vector, also used as coordinate value for some functions.</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">gamvas.Vector2D.prototype.length = function()</td></tr></table></blockquote>Return the length of the vector in pixels. </div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">gamvas.Vector2D.prototype.quickLength = function()</td></tr></table></blockquote>Returns the non sqrt() length of the vector, which is faster to calculate as it&rsquo;s real length. </div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">gamvas.Vector2D.prototype.normalized = function()</td></tr></table></blockquote>Returns the normalized vector of a vector. </div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.rotate = function(</td><td class="PParameter  prettyprint " nowrap>r</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Returns a new vector with the current vector rotated a certain angle. </div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.subtract = function(</td><td class="PParameter  prettyprint " nowrap>v</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Returns a new vector subtracting vector v from current vector</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.add = function(</td><td class="PParameter  prettyprint " nowrap>v</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Returns a new vector adding vector v to the current vector</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.difference = function(</td><td class="PParameter  prettyprint " nowrap>v</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Returns a new vector holding the difference between vector v and the current vector</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">gamvas.Vector2D.prototype.copy = function()</td></tr></table></blockquote>Returns a copy of the vector</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.distance = function(</td><td class="PParameter  prettyprint " nowrap>v</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the distance between the current vector and vector v</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>gamvas.Vector2D.prototype.quickDistance = function(</td><td class="PParameter  prettyprint " nowrap>v</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Returns a comparable distance between the current vector and vector v</div></div><div class=CToolTip id="tt13"><div class=CClass>A 2D vector class</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>